<form class="form-horizontal">
	<div class="tip-wrap">
		<div {{bind-attr class=":alert alertType formTip::hide"}}><strong>{{formTip}}</strong></div>
	</div>
	<div class="container confing-packetfilter-main form-horizontal">
		<div class="control-group">
			<label class="control-label">缺省策略</label>
			<div class="controls">
				{{view "select"
					class="span4"
					content=defaultpolicys
					optionLabelPath="content.displaytext"
					optionValuePath="content.value"
					value=form.glopolicy}}
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">过滤策略</label>
			<div class="controls">
				<div class="control-group">
					<button class="btn" {{action "openDialog"}}><i class="icon-plus"></i>添加</button>
					<button class="btn" {{action "delPolicy"}} disabled={{noneRulesChecked}}><i class="icon-trash"></i>删除</button>
				</div>
				<table class="conf-table conf-packetf-tab">
					<thead>
						<tr>
							<th class="config-tab-th tc" width="80">
								{{input type="checkbox" checked=checkedAll}}
							</th>
							<th class="config-tab-th" width="250">IP</th>
							<th class="config-tab-th" width="80">端口</th>
							<th class="config-tab-th">策略</th>
							<th class="config-tab-th">操作</th>
						</tr>
					</thead>
					<tbody>
						{{#each policyRules as |policyRule|}}
						<tr>
							<td class="tc">
								{{input type="checkbox" checked=policyRule.checked}}
							</td>
							<td>
								{{policyRule.ip}}
							</td>
							<td>
								{{policyRule.port}}
							</td>
							<td>
								{{policyRule.policyName}}
							</td>
							<td>
								<button class="btn btn-mini" {{action "singleDelPolicy" policyRule}}><i class="icon-trash"></i></button>
								<button class="btn btn-mini btn-up" {{action "upPriority" policyRule}} title="上移"><i class="icon-arrow-up"></i></button>
								<button class="btn btn-mini btn-down" {{action "downPriority" policyRule}} title="下移"><i class="icon-arrow-down"></i></button>
							</td>
						</tr>
						{{else}}
						<tr>
							<td colspan="5" class="tc">当前没有数据</td>
						</tr>
						{{/each}}
					</tbody>
				</table>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"></label>
			<div class="controls">
				<button class="btn btn-primary" {{action "save"}}>保存</button>
			</div>
		</div>
	</div>
</form>

{{#view view.Dialog
	id="packet_filter_add"
	title="添加过滤策略"
	autoOpen=false
	modal=true
	width=400
	height=300 
	class="common-popUp"
	buttons=dialogButtons}}
	<div id="dialog">
		<div {{bind-attr class=":alert alertType saveResult::hide"}}><strong>{{saveResult}}</strong></div>
			<div class="control-group">
			<label class="group-title">IP地址范围</label>
			<div class="group-content">
				{{input class="input  u-input-blue" value=form.ip}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.ip1 tooltip="IP地址范围，如192.168.0.1表示单机,192.168.0.1-192.168.0.10表示范围" }}
			</div>
		</div>

		<div class="control-group">
			<label class="group-title">端口范围</label>
			<div class="group-content">
				{{input class="input u-input-blue" value=form.port}}&nbsp;&nbsp;-&nbsp;
				{{input class="input u-input-blue" value=form.port1 tooltip="端口范围，如8080表示单个端口， 80-1000表示范围"}}
			</div>
		</div>
		<div class="control-group">
			<label class="group-title">策略</label>
			<div class="group-content">
				{{view "select"
				class="span4 u-input-blue"
				content=defaultpolicys
				optionLabelPath="content.displaytext"
				optionValuePath="content.value"
				value=form.policys}}
			</div>
		</div>

		<div class="control-group">
			<div class="group-content">
				<button type="submit" {{action "addPolicy"}} class="btn btn-primary">确定</button>
				<button type="button" {{action "closeDialog"}} class="btn">取消</button>
			</div>
		</div>
	</div>	
{{/view}}

{{#view view.Dialog
	id="packet_filter_upd"
	title="修改过滤策略"
	autoOpen=false
	modal=true
	width=355
	height=380
	buttons=dialogButtons}}
	<div id="dialog">
		<div {{bind-attr class=":alert alertType saveResult::hide"}}><strong>{{saveResult}}</strong></div>
			<div class="control-group">
			<label class="control-label">IP地址范围</label>
			<div class="controls">
				{{input class="input span2" value=form.ip}}&nbsp;&nbsp;-&nbsp;
				{{input class="input span2" value=form.ip1 tooltip="IP地址范围，如192.168.0.1表示单机,192.168.0.1-192.168.0.10表示范围" }}
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">端口范围</label>
			<div class="controls">
				{{input class="input span2" value=form.port}}&nbsp;&nbsp;-&nbsp;
				{{input class="input span2" value=form.port1 tooltip="端口范围，如8080表示单个端口， 80-1000表示范围"}}
			</div>
		</div>		
		<div class="control-group">
			<label class="control-label">策略</label>
			<div class="controls">
				{{view "select"
				class="span4"
				content=defaultpolicys
				optionLabelPath="content.displaytext"
				optionValuePath="content.value"
				value=form.policys}}
			</div>
		</div>

		<div class="control-group">
			<div class="controls">
				<button type="submit" {{action "updPolicy"}} class="btn btn-primary">确定</button>
				<button type="button" {{action "updCloseDialog"}} class="btn">取消</button>
			</div>
		</div>
	</div>	
{{/view}}